package com.dsl.dslallinone.dto;

import org.springframework.core.io.Resource;

/**
 * 导出结果
 */
public class ExportResult {
    private boolean success;
    private String message;
    private String fileName;
    private Resource resource;

    public ExportResult() {}

    public ExportResult(boolean success, String message) {
        this.success = success;
        this.message = message;
    }

    public ExportResult(boolean success, String fileName, Resource resource) {
        this.success = success;
        this.fileName = fileName;
        this.resource = resource;
    }

    public static ExportResult success(String fileName, Resource resource) {
        return new ExportResult(true, fileName, resource);
    }

    public static ExportResult error(String message) {
        return new ExportResult(false, message);
    }

    // Getters and Setters
    public boolean isSuccess() { return success; }
    public void setSuccess(boolean success) { this.success = success; }
    public String getMessage() { return message; }
    public void setMessage(String message) { this.message = message; }
    public String getFileName() { return fileName; }
    public void setFileName(String fileName) { this.fileName = fileName; }
    public Resource getResource() { return resource; }
    public void setResource(Resource resource) { this.resource = resource; }
}
